ParcelLabel API
Label Creation process
There are two methods for generating a label. you can either:
- Poll our API
- Utilize our webhook functionality
Flow 1: Polling our API
This process involves three key steps:
- Send a label creation request to the Create Label(s) endpoint—either domestic or international. This endpoint returns a consignment ID.
- Poll the status: Using the consignment ID from step 1, repeatedly call the Get Status of Label(s) endpoint until the consignment status is complete.
- Recommended polling interval: once per second
- Stop polling if the status is not complete within 30 seconds or if an error occurs.
- Download the label(s): Send a request to download all labels in the consignment.
Flow 2: Utilizing our Webhooks
Alternatively, merchants can choose to receive consignment notifications via a webhook, eliminating the need to repeatedly call the Get Status of Label(s) endpoint. This requires merchants to build a web service capable of receiving and processing webhook notifications.
- If all labels in the consignment are successfully generated, the status is sent to the URL specified in the notification_endpoint field.
- If any label fails to generate, an error message is sent to the same URL.
Refer to the Get Status of Label(s) documentation for response messages and examples.